# $Id: PKGBUILD 85418 2013-03-01 10:41:22Z andrea $
# Maintainer: Florian Pritz <flo@xinu.at>
# Contributor: toliman <altergan@hs-albsig.de>

pkgname=tipp10
pkgver=2.1.0
pkgrel=5
pkgdesc="intelligent typing tutor"
arch=('i686' 'x86_64')
url="http://www.tipp10.com/"
license=('GPL2')
depends=('qt4')
source=(defines.h.patch gcc-4.5.patch \
  "http://www.tipp10.com/de/download/tipp10_source_v"${pkgver//./-}".zip")
md5sums=('73a987123ca842026b7bde5e89370b86'
         'a9d388ddb17ae93f13acb915bc8eba57'
         '38c1e1fc9c5ba183279efdd22b318b7a')

_srcdir="$srcdir/tipp10_source_v${pkgver//./-}"

build() {
  cd "$_srcdir"

  sed -i 's#tipp10v2.template#../share/tipp10/tipp10v2.template#' def/defines.h
  patch -p0 < "$srcdir/defines.h.patch"
  patch -p0 < "$srcdir/gcc-4.5.patch"
  qmake
  make
}

package() {
  cd "$_srcdir"

	make DESTDIR="$pkgdir" install

  install -Dm755 tipp10 "$pkgdir/usr/bin/tipp10"
  install -Dm644 release/tipp10v2.template "$pkgdir/usr/share/tipp10/tipp10v2.template"
  install -Dm644 tipp10.png "$pkgdir/usr/share/pixmaps/tipp10.png"
  install -Dm644 tipp10.desktop "$pkgdir/usr/share/applications/tipp10.desktop"
}
